/**
 * Created by 坤 on 2017/2/26.
 */
$(function(){

    var choose=true;

    var zhouqishijianlayer='<li class="um_list_li">'+
                                '<div class=" um_list_right">'+
                                    '<div class="um_list_topInfo clearfix">'+
                                        '<div class="um_list_topInfo_header">'+
                                          '<p class="um_list_top_title">请输入事件名称:<input class="dasaoname"/></p>'+
                                        '</div>'+
                                    '</div>'+
                                    '<div class="um_list_centertime clearfix">'+
                                        '<div class="right fl"><input class="tradeDate" type="text" name="tradeDates" id="tradeDates" placeholder="起始时间" readonly /></div>'+
                                        '<div class="left fl" id="repeat_select_contact1"><input type="hidden" name="num" value="0"/><input type="hidden" name="unit" /><span id="repeat_show_contact1">设置周期时间</span></div>'+
                                    '</div>'+
                                    '<div class="um_list_edit clearfix">'+
                                    '<textarea placeholder="事件内容"></textarea>'+
                                    '</div>'+
                                    '<div class="um_list_bottomInfo">'+
                                        '<ul class="um_list_bottomInfo_images clearfix">'+
                                            '<li class="fl">'+
                                                '<a href="#">'+
                                                    '<img src="../../images/yuyin.png"/>'+
                                                '</a>'+
                                            '</li>'+
                                            '<li class="fl">'+
                                                '<a href="#">'+
                                                    '<img src="../../images/background-image.png"/>'+
                                                '</a>'+
                                            '</li>'+
                                        '</ul>'+
                                    '</div>'+
                                '</div>'+
                            '</li>';

    var oufashijian= '<li class="um_list_li">'+
                                '<div class=" um_list_right">'+
                                    '<div class="um_list_topInfo clearfix">'+
                                        '<div class="um_list_topInfo_header">'+
                                            '<p class="um_list_top_title">请输入事件名称:<input class="dasaoname"/></p>'+
                                        '</div>'+
                                    '</div>'+
                                    '<div class="um_list_centertime clearfix">'+
                                        '<div class="right fl"><input class="tradeDate" type="text" name="tradeDates" id="tradeDates" placeholder="事件时间" readonly /></div>'+
                                    '</div>'+
                                    '<div class="um_list_edit clearfix">'+
                                        '<textarea placeholder="事件内容"></textarea>'+
                                    '</div>'+
                                    '<div class="um_list_bottomInfo">'+
                                        '<ul class="um_list_bottomInfo_images clearfix">'+
                                            '<li class="fl">'+
                                                '<a href="#">'+
                                                   '<img src="../../images/yuyin.png"/>'+
                                                '</a>'+
                                            '</li>'+
                                            '<li class="fl">'+
                                                '<a href="#">'+
                                                   '<img src="../../images/background-image.png"/>'+
                                                '</a>'+
                                            '</li>'+
                                        '</ul>'+
                                    '</div>'+
                                '</div>'+
                            '</li>';

    var dasaoweisheng=  '<li class="um_list_li">'+
                            '<div class=" um_list_right">'+
                                '<div class="um_list_topInfo clearfix">'+
                                    '<div class="um_list_topInfo_header">'+
                                    '<p class="um_list_top_title">请输入位置:<input class="dasaoname"/></p>'+
                                    '</div>'+
                                '</div>'+
                                '<div class="um_list_centertime clearfix">'+
                                    '<div class="right fl"><input class="tradeDate" type="text" name="tradeDates" id="tradeDates" placeholder="起始时间" readonly /></div>'+
                                    '<div class="left fl" id="repeat_select_contact1"><input type="hidden" name="num" value="0"/><input type="hidden" name="unit" /><span id="repeat_show_contact1">设置周期时间</span></div>'+
                                '</div>'+
                                '<div class="um_list_bottomInfo">'+
                                    '<ul class="um_list_bottomInfo_images clearfix">'+
                                        '<li class="fl">'+
                                                '<a href="#">'+
                                                    '<img src="../../images/yuyin.png"/>'+
                                                '</a>'+
                                            '</li>'+
                                            '<li class="fl">'+
                                                '<a href="#">'+
                                                   '<img src="../../images/background-image.png"/>'+
                                                '</a>'+
                                        '</li>'+
                                    '</ul>'+
                                '</div>'+
                            '</div>'+
                        '</li>';
    var jiajuyongpin= '<li class="um_list_li">'+
                            '<div class=" um_list_right">'+
                                '<div class="um_list_topInfo clearfix">'+
                                    '<div class="um_list_topInfo_header">'+
                                       '<p class="um_list_top_title">请输入事件名称:<input class="dasaoname"/></p>'+
                                    '</div>'+
                                '</div>'+
                                '<div class="um_list_centertime clearfix">'+
                                    '<div class="right fl"><input class="tradeDate" type="text" name="tradeDates" id="tradeDatess" placeholder="起始时间" readonly /></div>'+
                                    '<div class="left fl" id="repeat_select_contact1"><input type="hidden" name="num" value="0"/><input type="hidden" name="unit" /><span id="repeat_show_contact1">设置周期时间</span></div>'+
                                '</div>'+
                                '<div class="um_list_edit clearfix">'+
                                '<textarea placeholder="作为一键复制内容"></textarea>'+
                                '</div>'+
                                '<div class="um_list_bottomInfo">'+
                                    '<ul class="um_list_bottomInfo_images clearfix">'+
                                        '<li class="fl">'+
                                            '<a href="#">'+
                                                 '<img src="../../images/yuyin.png"/>'+
                                            '</a>'+
                                        '</li>'+
                                        '<li class="fl">'+
                                            '<a href="#">'+
                                                '<img src="../../images/background-image.png"/>'+
                                            '</a>'+
                                        '</li>'+
                                    '</ul>'+
                                '</div>'+
                            '</div>'+
                        '</li>';

    $(".um_images").click(function(){
        layer.open({
            className:'zhouqi',
            content:zhouqishijianlayer,
            btn:["确定","取消"],
            success:function(elem){

                $(elem).find("#tradeDates").focus(function(){
                    var calendar = new LCalendar();
                    calendar.init({
                        'trigger': '#tradeDates', //标签id
                        'type': 'date', //date 调出日期选择 datetime 调出日期时间选择 time 调出时间选择 ym 调出年月选择,
                        'minDate': '1900-1-1', //最小日期
                        'maxDate': '2100-1-1' //最大日期
                    });
                });
                $(elem).find('#repeat_select_contact1').bind('click', function () {
                    var iosSelect = new IosSelect(3,
                        [
                            [{'id':'-1','value':'每'}],
                            [{'id':'1','value':'1'}, {'id':'2','value':'2'}, {'id':'3','value':'3'}, {'id':'4','value':'4'}, {'id':'5','value':'5'}, {'id':'6','value':'6'}, {'id':'7','value':'7'}, {'id':'8','value':'8'}, {'id':'9','value':'9'}],
                            [{'id':'day','value':'天'}, {'id':'week','value':'周'}, {'id':'month','value':'月'}, {'id':'year','value':'年'}]
                        ],
                        {
                            title: '设置重复',
                            itemHeight: 35,
                            callback: function (selectOneObj, selectTwoObj, selectThreeObj) {
                                $("input[name='num']").val(selectTwoObj.id);
                                $("input[name='unit']").val(selectThreeObj.id);
                                $('#repeat_show_contact1').text(selectOneObj.value + selectTwoObj.value + selectThreeObj.value);
                                $("#times_select_contact").show()
                            }
                        });
                });

            },
            //保存信息
            yes: function(index){
            }
        });
    })
    $(".icon-bianji1").click(function(){
        //询问框
        layer.open({
            className:'zhouqi',
            content:zhouqishijianlayer,
            btn:["确定","取消"],
            success:function(elem){

                $(elem).find("#tradeDates").focus(function(){
                    var calendar = new LCalendar();
                    calendar.init({
                        'trigger': '#tradeDates', //标签id
                        'type': 'date', //date 调出日期选择 datetime 调出日期时间选择 time 调出时间选择 ym 调出年月选择,
                        'minDate': '1900-1-1', //最小日期
                        'maxDate': '2100-1-1' //最大日期
                    });
                });
                $(elem).find('#repeat_select_contact1').bind('click', function () {
                    var iosSelect = new IosSelect(3,
                        [
                            [{'id':'-1','value':'每'}],
                            [{'id':'1','value':'1'}, {'id':'2','value':'2'}, {'id':'3','value':'3'}, {'id':'4','value':'4'}, {'id':'5','value':'5'}, {'id':'6','value':'6'}, {'id':'7','value':'7'}, {'id':'8','value':'8'}, {'id':'9','value':'9'}],
                            [{'id':'day','value':'天'}, {'id':'week','value':'周'}, {'id':'month','value':'月'}, {'id':'year','value':'年'}]
                        ],
                        {
                            title: '设置重复',
                            itemHeight: 35,
                            callback: function (selectOneObj, selectTwoObj, selectThreeObj) {
                                $("input[name='num']").val(selectTwoObj.id);
                                $("input[name='unit']").val(selectThreeObj.id);
                                $('#repeat_show_contact1').text(selectOneObj.value + selectTwoObj.value + selectThreeObj.value);
                                $("#times_select_contact").show()
                            }
                        });
                });

            },
            //保存信息
            yes: function(index){

            }
        });
    })

    $("#user_Memo .tabClick li").click(function(){

        $("#user_Memo .um_content .um_content_info .tabBox .tabList").removeClass("xianshi_1");
        $("#user_Memo .um_content .um_content_info .tabBox").children().eq($(this).index()).addClass("xianshi_1");

        if($(this).index()==0){
            $("#user_Memo .um_content .bottom-jiantou").animate({
                left:"0rem"
            },1000);
            $(".um_images").click(function(){
                layer.open({
                    className:'zhouqi',
                    content:zhouqishijianlayer,
                    btn:["确定","取消"],
                    success:function(elem){

                        $(elem).find("#tradeDates").focus(function(){
                            var calendar = new LCalendar();
                            calendar.init({
                                'trigger': '#tradeDates', //标签id
                                'type': 'date', //date 调出日期选择 datetime 调出日期时间选择 time 调出时间选择 ym 调出年月选择,
                                'minDate': '1900-1-1', //最小日期
                                'maxDate': '2100-1-1' //最大日期
                            });
                        });
                        $(elem).find('#repeat_select_contact1').bind('click', function () {
                            var iosSelect = new IosSelect(3,
                                [
                                    [{'id':'-1','value':'每'}],
                                    [{'id':'1','value':'1'}, {'id':'2','value':'2'}, {'id':'3','value':'3'}, {'id':'4','value':'4'}, {'id':'5','value':'5'}, {'id':'6','value':'6'}, {'id':'7','value':'7'}, {'id':'8','value':'8'}, {'id':'9','value':'9'}],
                                    [{'id':'day','value':'天'}, {'id':'week','value':'周'}, {'id':'month','value':'月'}, {'id':'year','value':'年'}]
                                ],
                                {
                                    title: '设置重复',
                                    itemHeight: 35,
                                    callback: function (selectOneObj, selectTwoObj, selectThreeObj) {
                                        $("input[name='num']").val(selectTwoObj.id);
                                        $("input[name='unit']").val(selectThreeObj.id);
                                        $('#repeat_show_contact1').text(selectOneObj.value + selectTwoObj.value + selectThreeObj.value);
                                        $("#times_select_contact").show()
                                    }
                                });
                        });

                    },
                    //保存信息
                    yes: function(index){

                    }
                });
            })

            $(".icon-bianji1").click(function(){
                //询问框
                layer.open({
                    className:'zhouqi',
                    content:zhouqishijianlayer,
                    btn:["确定","取消"],
                    success:function(elem){

                        $(elem).find("#tradeDates").focus(function(){
                            var calendar = new LCalendar();
                            calendar.init({
                                'trigger': '#tradeDates', //标签id
                                'type': 'date', //date 调出日期选择 datetime 调出日期时间选择 time 调出时间选择 ym 调出年月选择,
                                'minDate': '1900-1-1', //最小日期
                                'maxDate': '2100-1-1' //最大日期
                            });
                        });
                        $(elem).find('#repeat_select_contact1').bind('click', function () {
                            var iosSelect = new IosSelect(3,
                                [
                                    [{'id':'-1','value':'每'}],
                                    [{'id':'1','value':'1'}, {'id':'2','value':'2'}, {'id':'3','value':'3'}, {'id':'4','value':'4'}, {'id':'5','value':'5'}, {'id':'6','value':'6'}, {'id':'7','value':'7'}, {'id':'8','value':'8'}, {'id':'9','value':'9'}],
                                    [{'id':'day','value':'天'}, {'id':'week','value':'周'}, {'id':'month','value':'月'}, {'id':'year','value':'年'}]
                                ],
                                {
                                    title: '设置重复',
                                    itemHeight: 35,
                                    callback: function (selectOneObj, selectTwoObj, selectThreeObj) {
                                        $("input[name='num']").val(selectTwoObj.id);
                                        $("input[name='unit']").val(selectThreeObj.id);
                                        $('#repeat_show_contact1').text(selectOneObj.value + selectTwoObj.value + selectThreeObj.value);
                                        $("#times_select_contact").show()
                                    }
                                });
                        });

                    },
                    //保存信息
                    yes: function(index){

                    }
                });
            })
        }
        if($(this).index()==1){
            $("#user_Memo .um_content .bottom-jiantou").animate({
                left:"3.4rem"
            },1000);
            $(".um_images").click(function(){
                layer.open({
                    className:'oufa',
                    content:oufashijian,
                    btn:["确定","取消"],
                    success:function(elem){

                        $(elem).find("#tradeDates").focus(function(){
                            var calendar = new LCalendar();
                            calendar.init({
                                'trigger': '#tradeDates', //标签id
                                'type': 'date', //date 调出日期选择 datetime 调出日期时间选择 time 调出时间选择 ym 调出年月选择,
                                'minDate': '1900-1-1', //最小日期
                                'maxDate': '2100-1-1' //最大日期
                            });
                        });
                        $(elem).find('#repeat_select_contact1').bind('click', function () {
                            var iosSelect = new IosSelect(3,
                                [
                                    [{'id':'-1','value':'每'}],
                                    [{'id':'1','value':'1'}, {'id':'2','value':'2'}, {'id':'3','value':'3'}, {'id':'4','value':'4'}, {'id':'5','value':'5'}, {'id':'6','value':'6'}, {'id':'7','value':'7'}, {'id':'8','value':'8'}, {'id':'9','value':'9'}],
                                    [{'id':'day','value':'天'}, {'id':'week','value':'周'}, {'id':'month','value':'月'}, {'id':'year','value':'年'}]
                                ],
                                {
                                    title: '设置重复',
                                    itemHeight: 35,
                                    callback: function (selectOneObj, selectTwoObj, selectThreeObj) {
                                        $("input[name='num']").val(selectTwoObj.id);
                                        $("input[name='unit']").val(selectThreeObj.id);
                                        $('#repeat_show_contact1').text(selectOneObj.value + selectTwoObj.value + selectThreeObj.value);
                                        $("#times_select_contact").show()
                                    }
                                });
                        });

                    },
                    //保存信息
                    yes: function(index){

                    }
                });
            })

            $(".icon-bianji1").click(function(){
                //询问框
                layer.open({
                    className:'oufa',
                    content:oufashijian,
                    btn:["确定","取消"],
                    success:function(elem){

                        $(elem).find("#tradeDates").focus(function(){
                            var calendar = new LCalendar();
                            calendar.init({
                                'trigger': '#tradeDates', //标签id
                                'type': 'date', //date 调出日期选择 datetime 调出日期时间选择 time 调出时间选择 ym 调出年月选择,
                                'minDate': '1900-1-1', //最小日期
                                'maxDate': '2100-1-1' //最大日期
                            });
                        });
                        $(elem).find('#repeat_select_contact1').bind('click', function () {
                            var iosSelect = new IosSelect(3,
                                [
                                    [{'id':'-1','value':'每'}],
                                    [{'id':'1','value':'1'}, {'id':'2','value':'2'}, {'id':'3','value':'3'}, {'id':'4','value':'4'}, {'id':'5','value':'5'}, {'id':'6','value':'6'}, {'id':'7','value':'7'}, {'id':'8','value':'8'}, {'id':'9','value':'9'}],
                                    [{'id':'day','value':'天'}, {'id':'week','value':'周'}, {'id':'month','value':'月'}, {'id':'year','value':'年'}]
                                ],
                                {
                                    title: '设置重复',
                                    itemHeight: 35,
                                    callback: function (selectOneObj, selectTwoObj, selectThreeObj) {
                                        $("input[name='num']").val(selectTwoObj.id);
                                        $("input[name='unit']").val(selectThreeObj.id);
                                        $('#repeat_show_contact1').text(selectOneObj.value + selectTwoObj.value + selectThreeObj.value);
                                        $("#times_select_contact").show()
                                    }
                                });
                        });

                    },
                    //保存信息
                    yes: function(index){

                    }
                });
            })
        }
        if($(this).index()==2){
            $("#user_Memo .um_content .bottom-jiantou").animate({
                left:"6.9rem"
            },1000);
            $(".um_images").click(function(){
                layer.open({
                    className:'dasao',
                    content:dasaoweisheng,
                    btn:["确定","取消"],
                    success:function(elem){

                       $(elem).find("#tradeDates").focus(function(){
                           var calendar = new LCalendar();
                           calendar.init({
                               'trigger': '#tradeDates', //标签id
                               'type': 'date', //date 调出日期选择 datetime 调出日期时间选择 time 调出时间选择 ym 调出年月选择,
                               'minDate': '1900-1-1', //最小日期
                               'maxDate': '2100-1-1' //最大日期
                           });
                        });
                        $(elem).find('#repeat_select_contact1').bind('click', function () {
                            var iosSelect = new IosSelect(3,
                                [
                                    [{'id':'-1','value':'每'}],
                                    [{'id':'1','value':'1'}, {'id':'2','value':'2'}, {'id':'3','value':'3'}, {'id':'4','value':'4'}, {'id':'5','value':'5'}, {'id':'6','value':'6'}, {'id':'7','value':'7'}, {'id':'8','value':'8'}, {'id':'9','value':'9'}],
                                    [{'id':'day','value':'天'}, {'id':'week','value':'周'}, {'id':'month','value':'月'}, {'id':'year','value':'年'}]
                                ],
                                {
                                    title: '设置重复',
                                    itemHeight: 35,
                                    callback: function (selectOneObj, selectTwoObj, selectThreeObj) {
                                        $("input[name='num']").val(selectTwoObj.id);
                                        $("input[name='unit']").val(selectThreeObj.id);
                                        $('#repeat_show_contact1').text(selectOneObj.value + selectTwoObj.value + selectThreeObj.value);
                                        $("#times_select_contact").show()
                                    }
                                });
                        });

                    },
                    //保存信息
                    yes: function(index){

                    }
                });
            })

            $(".icon-bianji1").click(function(){
                //询问框
                layer.open({
                    className:'dasao',
                    content:dasaoweisheng,
                    btn:["确定","取消"],
                    success:function(elem){

                        $(elem).find("#tradeDates").focus(function(){
                            var calendar = new LCalendar();
                            calendar.init({
                                'trigger': '#tradeDates', //标签id
                                'type': 'date', //date 调出日期选择 datetime 调出日期时间选择 time 调出时间选择 ym 调出年月选择,
                                'minDate': '1900-1-1', //最小日期
                                'maxDate': '2100-1-1' //最大日期
                            });
                        });
                        $(elem).find('#repeat_select_contact1').bind('click', function () {
                            var iosSelect = new IosSelect(3,
                                [
                                    [{'id':'-1','value':'每'}],
                                    [{'id':'1','value':'1'}, {'id':'2','value':'2'}, {'id':'3','value':'3'}, {'id':'4','value':'4'}, {'id':'5','value':'5'}, {'id':'6','value':'6'}, {'id':'7','value':'7'}, {'id':'8','value':'8'}, {'id':'9','value':'9'}],
                                    [{'id':'day','value':'天'}, {'id':'week','value':'周'}, {'id':'month','value':'月'}, {'id':'year','value':'年'}]
                                ],
                                {
                                    title: '设置重复',
                                    itemHeight: 35,
                                    callback: function (selectOneObj, selectTwoObj, selectThreeObj) {
                                        $("input[name='num']").val(selectTwoObj.id);
                                        $("input[name='unit']").val(selectThreeObj.id);
                                        $('#repeat_show_contact1').text(selectOneObj.value + selectTwoObj.value + selectThreeObj.value);
                                        $("#times_select_contact").show()
                                    }
                                });
                        });

                    },
                    //保存信息
                    yes: function(index){

                    }
                });
            })
        }
        if($(this).index()==3){
            $("#user_Memo .um_content .bottom-jiantou").animate({
                left:"10.4rem"
            },1000);
            $(".um_images").click(function(){
                layer.open({
                    className:'jiaju',
                    content:jiajuyongpin,
                    btn:["确定","取消"],
                    success:function(elem){

                        $(elem).find("#tradeDatess").focus(function(){
                            var calendar = new LCalendar();
                            calendar.init({
                                'trigger': '#tradeDatess', //标签id
                                'type': 'date', //date 调出日期选择 datetime 调出日期时间选择 time 调出时间选择 ym 调出年月选择,
                                'minDate': '1900-1-1', //最小日期
                                'maxDate': '2100-1-1' //最大日期
                            });
                        });
                        $(elem).find('#repeat_select_contact1').bind('click', function () {
                            var iosSelect = new IosSelect(3,
                                [
                                    [{'id':'-1','value':'每'}],
                                    [{'id':'1','value':'1'}, {'id':'2','value':'2'}, {'id':'3','value':'3'}, {'id':'4','value':'4'}, {'id':'5','value':'5'}, {'id':'6','value':'6'}, {'id':'7','value':'7'}, {'id':'8','value':'8'}, {'id':'9','value':'9'}],
                                    [{'id':'day','value':'天'}, {'id':'week','value':'周'}, {'id':'month','value':'月'}, {'id':'year','value':'年'}]
                                ],
                                {
                                    title: '设置重复',
                                    itemHeight: 35,
                                    callback: function (selectOneObj, selectTwoObj, selectThreeObj) {
                                        $("input[name='num']").val(selectTwoObj.id);
                                        $("input[name='unit']").val(selectThreeObj.id);
                                        $('#repeat_show_contact1').text(selectOneObj.value + selectTwoObj.value + selectThreeObj.value);
                                        $("#times_select_contact").show()
                                    }
                                });
                        });

                    },
                    //保存信息
                    yes: function(index){

                    }
                });
            })

            $(".jiajuyongpin .um_list_li .lp_list_leftInfo").click(function(){
                //询问框
                layer.open({
                    className:'jiaju',
                    content:jiajuyongpin,
                    btn:["确定","取消"],
                    success:function(elem){

                        $(elem).find("#tradeDatess").focus(function(){
                            var calendar = new LCalendar();
                            calendar.init({
                                'trigger': '#tradeDatess', //标签id
                                'type': 'date', //date 调出日期选择 datetime 调出日期时间选择 time 调出时间选择 ym 调出年月选择,
                                'minDate': '1900-1-1', //最小日期
                                'maxDate': '2100-1-1' //最大日期
                            });
                        });
                        $(elem).find('#repeat_select_contact1').bind('click', function () {
                            var iosSelect = new IosSelect(3,
                                [
                                    [{'id':'-1','value':'每'}],
                                    [{'id':'1','value':'1'}, {'id':'2','value':'2'}, {'id':'3','value':'3'}, {'id':'4','value':'4'}, {'id':'5','value':'5'}, {'id':'6','value':'6'}, {'id':'7','value':'7'}, {'id':'8','value':'8'}, {'id':'9','value':'9'}],
                                    [{'id':'day','value':'天'}, {'id':'week','value':'周'}, {'id':'month','value':'月'}, {'id':'year','value':'年'}]
                                ],
                                {
                                    title: '设置重复',
                                    itemHeight: 35,
                                    callback: function (selectOneObj, selectTwoObj, selectThreeObj) {
                                        $("input[name='num']").val(selectTwoObj.id);
                                        $("input[name='unit']").val(selectThreeObj.id);
                                        $('#repeat_show_contact1').text(selectOneObj.value + selectTwoObj.value + selectThreeObj.value);
                                        $("#times_select_contact").show()
                                    }
                                });
                        });

                    },
                    //保存信息
                    yes: function(index){

                    }
                });
            })
        }
    });
    $(".chk_3").click(function() {

        if (choose == true) {
            $(this).parent().parent().children("span").html("提醒：开")
            choose=false;
        }else{
            $(this).parent().parent().children("span").html("提醒：关")
            choose=true;
        }
    })
    $(".icon-lajixiang01").click(function(){
        //询问框
        var ceng=$(this).parents(".um_list_li");
        layer.open({
            className:"queen",
            content: '您确定要删除本条信息吗？'
            ,btn: ['确定', '不要']
            ,yes: function(index){
                ceng.remove();
                layer.close(index);
            }
        });
    })

    /*时间控件*/
    var calendar = new LCalendar();
    calendar.init({
        'trigger': '#tradeDate', //标签id
        'type': 'date', //date 调出日期选择 datetime 调出日期时间选择 time 调出时间选择 ym 调出年月选择,
        'minDate': '1900-1-1', //最小日期
        'maxDate': '2100-1-1' //最大日期
    });
    /*设置时间间隔*/
    $('#repeat_select_contact').bind('click', function () {
        var iosSelect = new IosSelect(3,
            [
                [{'id':'-1','value':'每'}],
                [{'id':'1','value':'1'}, {'id':'2','value':'2'}, {'id':'3','value':'3'}, {'id':'4','value':'4'}, {'id':'5','value':'5'}, {'id':'6','value':'6'}, {'id':'7','value':'7'}, {'id':'8','value':'8'}, {'id':'9','value':'9'}],
                [{'id':'day','value':'天'}, {'id':'week','value':'周'}, {'id':'month','value':'月'}, {'id':'year','value':'年'}]
            ],
            {
                title: '设置重复',
                itemHeight: 35,
                callback: function (selectOneObj, selectTwoObj, selectThreeObj) {
                    $("input[name='num']").val(selectTwoObj.id);
                    $("input[name='unit']").val(selectThreeObj.id);
                    $('#repeat_show_contact').text(selectOneObj.value + selectTwoObj.value + selectThreeObj.value);
                    $("#times_select_contact").show()
                }
            });
    });
});